home *** CD-ROM | disk | FTP | other *** search
- /* m2c.ged $VER: 0.52 m2c.ged © 1994 Fin Schuppenhauer (13.06.94) */
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
-
-
- 'QUERY CAT'
- german = (result = "deutsch")
-
- /* Dateinamen ermitteln: */
- 'QUERY FILE VAR FILENAME'
- if (right(filename, 4) ~= '.def') & (right(filename, 4) ~= '.mod') then do
- if german then
- 'REQUEST BODY="Dies ist kein Modula-2-Quelltext!"'
- else
- 'REQUEST BODY="This is no modula-2 source!"'
- 'UNLOCK'
- EXIT
- end
-
- /* Gibt es überhaupt etwas zu übersetzen ? */
- 'QUERY ANYTEXT'
- if result = 'FALSE' then do
- if german then
- 'REQUEST BODY="Ähmm, was soll ich den übersetzen?"'
- else
- 'REQUEST BODY="There''s no source to compile!"'
- 'UNLOCK'
- EXIT
- end
-
- /* Text verändert? Wenn ja, vorher sichern. */
- 'QUERY MODIFY'
- if result = 'TRUE' then
- 'SAVE ALL'
-
- /* Ist der Compiler aktiv ? */
- if ~show('P', 'M2C') then do
- if german then
- 'REQUEST BODY="Der Compiler läuft nicht!||Bitte starten."'
- else
- 'REQUEST BODY="The Compiler is not running!||Please start."'
- 'UNLOCK'
- EXIT
- end
-
- /* Compiler-Optionen ermitteln (sind alle per Default TRUE) */
- compopt = "-"
- 'QUERY USER1' /* StackChk */
- if result='FALSE' then
- compopt = compopt || "s"
-
- 'QUERY USER2' /* RangeChk */
- if result='FALSE' then
- compopt = compopt || "r"
-
- 'QUERY USER3' /* OverflowChk */
- if result='FALSE' then
- compopt = compopt || "v"
-
- 'QUERY USER4' /* NilChk */
- if result='FALSE' then
- compopt = compopt || "n"
-
- 'QUERY USER5' /* EntryClear */
- if result='FALSE' then
- compopt = compopt || "e"
-
- 'QUERY USER6' /* CaseChk */
- if result='FALSE' then
- compopt = compopt || "c"
-
- 'QUERY USER7' /* ReturnChk */
- if result='FALSE' then
- compopt = compopt || "f"
-
- 'QUERY USER8' /* LongAlign */
- if result='FALSE' then
- compopt = compopt || "l"
-
- 'QUERY USER9' /* Volatile */
- if result='FALSE' then
- compopt = compopt || "h"
-
- 'QUERY USER10' /* LargeVars */
- if result='FALSE' then
- compopt = compopt || "y"
-
- 'QUERY USER11' /* StackParms */
- if result='FALSE' then
- compopt = compopt || "z"
-
- /* Optimieren und/oder Debug-Informationen ? */
- 'QUERY USER12 VAR OPT' /* Optimieren ? */
- 'QUERY USER13 VAR DBG' /* Debug-Info ? */
- if (opt = 'TRUE') & (dbg = 'TRUE') then
- optdbg = "+@"
- if (opt = 'TRUE') & (dbg = 'FALSE') then
- optdbg = "-d"
- if (opt = 'FALSE') & (dbg = 'TRUE') then
- optdbg = "+d"
- if (opt = 'FALSE') & (dbg = 'FALSE') then
- optdbg = "-@"
-
- /* Piktogramme erzeugen? */
- 'QUERY USER14'
- if result = 'TRUE' then
- icons = "+i"
- else
- icons = "-i"
-
- if german then
- 'REQUEST STATUS="Übersetze nun 'filename' ..."'
- else
- 'REQUEST STATUS="Compiling 'filename' ..."'
-
- OPTIONS FAILAT 21
- ADDRESS 'M2C' "COMPILE " || compopt || optdbg || icons || " " || filename
-
- 'REQUEST STATUS=""'
-
- if rc ~= 0 then do
- if german then
- 'REQUEST BODY="Es sind Fehler aufgetreten!"'
- else
- 'REQUEST BODY="Some errors occured!"'
- end
- else do
- if german then
- 'REQUEST BODY="Erfolgreiche Übersetzung."'
- else
- 'REQUEST BODY="Successfull compilation."'
- end
-
- /* ---------------------------- END OF YOUR CODE --------------------- */
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-